package com.justech.eat.controller;

import com.justech.eat.entity.OrderParameter;
import com.justech.eat.service.OrderParameterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@Validated
@RequestMapping("orderParameter")
public class OrderParameterController {
    @Autowired
    OrderParameterService orderParameterService;

    @RequestMapping("/save")
    public void save(@RequestBody @Valid OrderParameter orderParameter){
    orderParameterService.save(orderParameter);
    }

    @RequestMapping("/update")
    public void update(@RequestBody @Valid OrderParameter orderParameter){
        orderParameterService.update(orderParameter);
    }

    @RequestMapping("/query")
    public OrderParameter query(int dateType){
        return orderParameterService.query(dateType);
    }

}
